package com.atguigu.springcloud.controller;

import com.atguigu.springcloud.entities.CommonResult;
import com.atguigu.springcloud.entities.Payment;
import com.atguigu.springcloud.service.PaymentFeignService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author XuZhuHong
 * @CreateTime 2021/11/4 17:30
 */
@RestController
public class OrderFeignController {
    //自动注入service
    @Resource
    private PaymentFeignService paymentFeignService;

    //写对应的请求地址
    @GetMapping(value = "/consumer/payment/get/{id}")
    public CommonResult< Payment > getPaymentById(@PathVariable("id") Long id)
    {
        return paymentFeignService.getPaymentById(id);
    }
}
